#pragma once
#include "..\common.h"
#include "DObject.h"
#include "../scheduler/DTask.h"

#define DCR_HUNGER_INIT 100.0
#define DCR_HUNGER_MAX 285.0
#define DCR_HUNGER_PER_TICK 0.05

namespace DeepClasses
{

	class DCreature : public DObject
	{
	public:
		DCreature(DString name, wchar_t code, short color);
		virtual ~DCreature();

		DTask* m_task;

		// current state of the creature like health or hunger
		struct CREATURE_STATE
		{
			// when reaches zero, creature starves to death
			double hunger;
		} m_state;

		// characteristics of the creature like how many energy it spends per tick
		struct CREATURE_PROPS
		{
			double hunger_max;
			double hunger_per_tick;
		} m_properties;

		// performs one atomic life cycle
		virtual int Tick();

		virtual int InsertTask(DTask* tsk);
		virtual int ClearTasks();

		virtual int Place(TLocation loc);
		virtual int Move(TLocation newLoc);


	};

	class DDwarf : public DCreature
	{
	public:
		DDwarf(DString name, wchar_t code, short color);
		virtual ~DDwarf();

		virtual int Tick();
	};
};